//
//  Segmented.m
//  MGLOL盒子
//
//  Created by lanou3g on 15/11/30.
//  Copyright © 2015年 张明. All rights reserved.
//

#import "Segmented.h"
static Segmented *segm = nil;
@implementation Segmented
- (void)seg:(NSArray *)itemArr {
    self.segment = [[UISegmentedControl alloc]initWithItems:itemArr];
    self.segment.backgroundColor = [UIColor whiteColor];
    [self.segment setTintColor:[UIColor grayColor]];
    self.segment.frame = CGRectMake(0, 0, CGRectGetWidth(self.frame), 30);
    [self addSubview:_segment];

}
+(instancetype)shareSegment {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        if (!segm) {
            segm = [[Segmented alloc]initWithFrame:CGRectMake(0, 64, 414, 30)];
        }
    });
    return segm;


}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
